""" 判断是不是2的幂
使用与位运算 """
def check(n):
    return n>0 and n & (n-1) == 0
    
    
    if n <1: return False
    while n != 1:
        if n %2 == 1 :return False
        n = n/2 
    
    return True


print(check(32))